package com.easybuy.service.impl;

import com.easybuy.bean.EasybuyProduct;
import com.easybuy.mapper.EasybuyProductMapper;
import com.easybuy.service.IProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class ProductServiceImpl implements IProductService {
    @Autowired
    private EasybuyProductMapper easybuyProductMapper;
    @Override
    public List<EasybuyProduct> listByPage(int page,int pageSize){
        int from=(page -1)*pageSize;
        return easybuyProductMapper.listByPage(from,pageSize);
    }
   // int deleteByPk(int epId);
    public int deleteByPk(int id){
        return easybuyProductMapper.deleteByPk(id);
    }
    public int updateByPk(EasybuyProduct ebProduct){
        return easybuyProductMapper.updateByPk(ebProduct);
    }
    public   EasybuyProduct selectByCondition(Integer id){
        return easybuyProductMapper.selectByCondition(id);
    }
    public int countAll(){
        return easybuyProductMapper.countAll();
    }
    public int save(EasybuyProduct ebProduct){
        return easybuyProductMapper.save(ebProduct);
    }
    public EasybuyProduct findByName(String name){
        return easybuyProductMapper.findByName(name);
    }
    public EasybuyProduct findByPk(Integer id){
        return easybuyProductMapper.findByPk(id);
    }
    public  EasybuyProduct findByfid(Integer id){
        return easybuyProductMapper.findByfid(id);
    }
    public EasybuyProduct findBysid(Integer id){
        return easybuyProductMapper.findBysid(id);
    }



    @Override
    public EasybuyProduct detail(Integer epId) {
        return easybuyProductMapper.findByPk(epId);
    }


}
